ae0842b4f969cfb29f0832cd6003e631de61ab3a,src/test/java/ac/simons/tests/oembed/ExampleTest.java,ExampleTest,youtubeJson,#,55

Before Change


public class ExampleTest {
	@Test
	public void youtubeJson() throws OembedException {
		final Oembed oembed = new Oembed(new DefaultHttpClient());
		oembed.withProvider(
				new DefaultOembedProvider()
					.withName("youtube")
					.withFormat("json")
					.withMaxWidth(480)
					.withEndpoint("http://www.youtube.com/oembed")
					.withUrlScheme("http://(www|de)\\.youtube\\.com/watch\\?v=.*")
				);
		OembedResponse response = oembed.transformUrl("http://www.youtube.com/watch?v=lh_em3-ndVw");
		System.out.println(response);
	}

After Change


public class ExampleTest {
	@Test
	public void youtubeJson() throws OembedException {		
		final Oembed oembed = new OembedBuilder(new DefaultHttpClient())
			.withProviders(
				new OembedProviderBuilder()
					.withName("youtube")
					.withFormat("json")
					.withMaxWidth(480)
					.withEndpoint("http://www.youtube.com/oembed")
					.withUrlSchemes("http://(www|de)\\.youtube\\.com/watch\\?v=.*")
					.build()
				)
			.build();
		OembedResponse response = oembed.transformUrl("http://www.youtube.com/watch?v=lh_em3-ndVw");
		System.out.println(response);
	}